from django.contrib import admin
from fundinfo.models import *

# Register your models here.

class FundNameAdmin(admin.ModelAdmin):
    list_display = ['code','name','company','type', 'risk', 'selfType']
    search_fields = ['code']

admin.site.register(FundName, FundNameAdmin)

class FundInfoBriefAdmin(admin.ModelAdmin):
    list_display = ['fund','incomeDay','incomeDayRate','incomeDayDate', 'totalIncome', 
                    'curCost', 'curIncome', 'curIncomeRate', 'curValue', 'curUnits', 
                    'incomeRate1M', 'incomeRate3M', 'incomeRate6M', 'incomeRate1Y', 'incomeRate2Y', 'incomeRate3Y', 'incomeRate5Y',
                    'alarm', 'alarmText', 'note']
    autocomplete_fields = ['fund']
    #search_fields = ('fund_name',)

admin.site.register(FundInfoBrief, FundInfoBriefAdmin)

class CustomCategoryNameAdmin(admin.ModelAdmin):
    list_display = ['name','priority']
    #search_fields = ('fund_name',)

admin.site.register(CustomCategoryName, CustomCategoryNameAdmin)

class CustomCategoryAdmin(admin.ModelAdmin):
    list_display = ['name','fund','key1','key2', 'key3', 'key4', 'key5', 'key6']
    autocomplete_fields = ['fund']
    #search_fields = ('fund_name',)

admin.site.register(CustomCategory, CustomCategoryAdmin)